<!-- 采购名称控件 -->
<template>
  <a-space direction="vertical" style="width: 100%">
    <a-input
      :disabled="true"
      v-model="TotalAmount"
      :placeholder="props.props.placeholder"
    />
  </a-space>
</template>

<script lang="ts" setup>
  import { ref, computed, watchEffect, onMounted } from 'vue';
  import mitter from '@/utils/mitt';
  import { useRoute } from 'vue-router';

  const route = useRoute();
  const props = withDefaults(
    defineProps<{
      props: { [propName: string]: any };
      name?: string;
      required?: boolean;
      oneValue: any;
      disabled?: boolean;
      regex?: {
        [name: string]: {
          role: any;
          name: any;
        };
      };
    }>(),
    {}
  );
  const emit = defineEmits(['update:oneValue']);

  const TotalAmount = computed<any>({
    get: () => {
      return Number(props.oneValue);
    },
    set: (val) => {
      emit('update:oneValue', Number(val));
    },
  });

  mitter.on('getTotalAmount', (val: any) => {
    TotalAmount.value = val;
  });
</script>

<style scoped lang="less">
  // :deep(.arco-input[disabled]) {
  //   -webkit-text-fill-color: rgb(0, 0, 0);
  // }
</style>
